package com.zly.framework.rbac.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * Knife4j配置
 */
@Configuration
@Profile({"dev"})
public class OpenapiConfig {
    // 配置相关内容
    @Bean
    public OpenAPI springShopOpenAPI() {
        return new OpenAPI()
                // 接口文档标题
                .info(new Info().title("rbac+SpringSecurity的权限框架")
                        .description("这是基于Knife4j OpenApi3的接口文档")   // 接口文档简介
                        .version("v1.0") // 接口文档版本
                        .termsOfService("权限框架")
                        .contact(new Contact()
                                .name("zly")
                                .email("3065400350@qq.com")
                        )
                ) // 开发者联系方式
                .externalDocs(new ExternalDocumentation()
                        .description("SpringBoot基础框架")
                        .url("https://gitee.com/zhong-liuyang/rbac_basic.git"));
    }
}
